#include "vector.hpp"
#include <vector>
#include <iostream>
using namespace std;

void vector_test3()
{
    vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);
    v.resize(10, 5);
    for (auto e : v)
    {
        cout << e << ' ';
    }
    cout << endl;

    for (size_t i = 0; i < v.size(); i++)
    {
        v[i] = 10 + i;
    }

    for (auto e : v)
    {
        cout << e << ' ';
    }
    cout << endl;

    v.resize(1);

    for (auto e : v)
    {
        cout << e << ' ';
    }
    cout << endl;
}
class Solution
{
public:
    vector<vector<int>> generate(int numRows)
    {
        vector<vector<int>> vv;
        vv.resize(numRows);
        for (size_t i = 0; i < vv.size(); i++)
        {
            vv[i].resize(i + 1, 0);
            vv[i][0] = vv[i][vv[i].size() - 1] = 1;
        }
        for (size_t i = 0; i < vv.size(); i++)
        {
            for (size_t j = 0; j < vv[i].size(); j++)
            {
                if (vv[i][j] == 0)
                    vv[i][j] = vv[i - 1][j - 1] + vv[i - 1][j];
            }
        }
        return vv;
    }
};
void vector_test4()
{
    string s("abc");
    vector<int> v(s.begin(), s.end());
    for (auto e : v)
    {
        cout << e << ' ';
    }
    cout << endl
        << "-----------------------" << endl;

    vector<int> v1(v);
    for (auto e : v1)
    {
        cout << e << ' ';
    }
    cout << endl
        << "-----------------------" << endl;

    vector<int> v2;
    v2 = v1;
    for (auto e : v2)
    {
        cout << e << ' ';
    }
    cout << endl
        << "-----------------------" << endl;

    vector<string> v3(3, "1111");
    for (auto e : v3)
    {
        cout << e << ' ';
    }
    cout << endl
        << "-----------------------" << endl;

    vector<vector<int>> v4 = Solution().generate(5);

    for (size_t i = 0; i < v4.size(); i++)
    {
        for (size_t j = 0; j < v4[i].size(); j++)
        {
            cout << v4[i][j] << ' ';
        }
        cout << endl;
    }
    cout << endl << "-----------------------" << endl;
}

int main()
{
    // my_vector::vector_test1();
    //my_vector::vector_test2();
    //my_vector::vector_test3();
    //cout << "---------" << endl;
    //vector_test3();
    my_vector::vector_test4();
    cout << "222222222---------" << endl;

    vector_test4();

    return 0;
}